package com.javacoo.xservice.example.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.javacoo.xservice.base.AbstractUrlParamController;
import com.javacoo.xservice.base.exception.IllegalParameterException;
import com.javacoo.xservice.example.service.ExampleService;

import lombok.extern.slf4j.Slf4j;

/**
 * 获取案例数据接口,url参数
 * <p>说明:</p>
 * <li></li>
 * @author DuanYong
 * @since 2017年7月17日上午9:02:56
 */
@Slf4j
@RestController
@RequestMapping(value = "/example/v1/getUrlParamExampleInfo")
public class ExampleUrlParamController extends AbstractUrlParamController {
	/** 数据服务 */
	@Autowired
	private ExampleService exampleService;


    @Override
    protected void validate(Map<String, String> p) throws IllegalParameterException {
        log.info("validate->{}",p);

    }

    @Override
    protected Object process(Map<String, String> p) {
        return exampleService.getExampleInfo(p.get("id"));
    }
}
